﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FrameworkManapro.BusinessModel;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace GMAC.ReportingSystem.Business.Entities
{
    //--------------------------------------------------------
    /// <summary>
    /// Ricardo Recaredo (23/03/2011)
    /// 
    /// Entity that Link any Call maked by an Agent
    /// to the related Reason.
    /// 
    /// </summary>
    //--------------------------------------------------------

    [DbProcedures(Insert = "", Update = "procCallByAgentsUpdate", Delete = "")]
    [Serializable]
    public class CallReasonByAgent: BusinessEntity ,ICloneable
    {
        //-------------------------------------------
         /// <summary>
        /// Gets or sets the Product (aka AccountType).
        /// </summary>
        /// <value>The ID.</value>
        //-------------------------------------------

        [DbParameter(0, 1, 0)]
        public Product AccountType { get; set; }

        //-------------------------------------------
        /// <summary>
        /// Gets or sets the Call Reason.
        /// </summary>
        /// <value>The UserName.</value>
        //-------------------------------------------

        [DbParameter(0, 2, 0)]
        public CallReason CallReason { get; set; }

        //-------------------------------------------
	    /// <summary>
        /// Gets or sets the Agent Caller.
        /// </summary>
        /// <value>The FirstName.</value>
        //-------------------------------------------

        [DbParameter(0, 3, 0)]
        public Agent Agent { get; set; }

        //-------------------------------------------
        /// <summary>
        /// Gets or sets the call Date.
        /// </summary>
        /// <value>The LastName.</value>
        //-------------------------------------------
        
        [DbParameter(0, 4, 0)]
        public DateTime CallDate { get; set; }

        //-------------------------------------------
	    /// <summary>
        /// Gets or sets the ManagementGroup.
        /// </summary>
        /// <value>The ManagementGroup.</value>
        //-------------------------------------------
        
        [DbParameter(0, 5, 0)]
        public int NumberOfCalls { get; set; }

        ///////////////////////////////////////////////////////

        #region ICloneable Members

        public object Clone()
        {
            CallReasonByAgent cloneObject = new CallReasonByAgent();

            cloneObject.AccountType   = this.AccountType;
            cloneObject.Agent         = this.Agent;
            cloneObject.CallDate      = this.CallDate;
            cloneObject.CallReason    = this.CallReason;
            cloneObject.NumberOfCalls = this.NumberOfCalls;

            return (object)cloneObject;
        }

        #endregion
    }

    //-------------------------------------------
    /// <summary>
    /// Collection of CallReasonByAgent for listing.
    /// </summary>
    //-------------------------------------------

    public class CallReasonByAgentCollection : List<CallReasonByAgent>
    {
        public int TotalResults { get; set; }
    }
}
